﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



namespace ChatForum.Client
{
    public partial class LoggedInMemberLayout : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            accountLink.Text = HttpContext.Current.User.Identity.Name;
            userList.DataSource = ServiceHelper.Instance.AccountService.GetAllUser().Where(u => u.UserId != HttpContext.Current.User.Identity.Name);
            userList.DataBind();
        }
        protected void OnLogout(object sender, EventArgs e)
        {
            Handler.OnLogout(HttpContext.Current.User.Identity.Name);
        }
        protected void FilterUser(object sender, EventArgs e)
        {
            userList.DataSource = ServiceHelper.Instance.AccountService.GetAllUser().Where(u => u.UserId.Contains(txtSearchOnlineUser.Text));
            userList.DataBind();
        }
    }
}